<template>
  <div class="relics-wrapper">
    <div class="my-image image-mask image-loaded relics-image" style="width: 100%; height: 100%;">
      <img class="my-image-img" :src="imgUrl" lazy="true" style="object-fit: contain;">
    </div>
    <div class="relics-card">
      <div class="relics-card-name t-ellipsis ff-s">{{ title }}</div>
      <div class="relics-card-desc t-ellipsis">{{ desc }}</div>
    </div>
  </div>
</template>

<script setup>
defineOptions({ name: "RelicsCard" });
defineProps({
  title: {
    type: String,
    default: "1"
  },
  desc: {
    type: String,
    default: "1"
  },
  imgUrl: {
    type: String,
    default: ""
  }
})
</script>

<style lang="scss" scoped>
.relics-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;

  &:hover {
    .my-image-img {
      transform: scale(1.2);
    }
  }

  .relics-image {
    transition: .3s ease;
  }

  .my-image {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000000c0;
    backdrop-filter: blur(10px);

    .my-image-img {
      display: block;
      width: 100%;
      height: 100%;
      opacity: 1;
      pointer-events: none;
      transition: .3s ease;
      z-index: 0;

    }
  }

  .relics-card {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    width: 100%;
    height: 100%;
    text-align: left;
    color: #fffdf9;
    box-sizing: border-box;
    cursor: pointer;

    &::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      display: block;
      width: 100%;
      height: 100%;
      background: linear-gradient(180.53deg, rgba(2, 9, 10, 0) 59.91%, rgba(2, 9, 10, .95) 99.5%);
      z-index: 1;
    }

    .relics-card-name {
      margin-top: 12px;
      font-size: 24px;
      line-height: 34px;
      font-weight: 600;
      z-index: 1;
    }

    .relics-card-desc {
      margin-top: 8px;
      font-size: 14px;
      line-height: 22px;
      font-weight: 400;
      z-index: 1;
    }
  }
}
</style>